package javacore.day10.AdapterSortNumber;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;

public class SortListAdapter implements Sorter {

	
	
	
	@Override
	public Object[] sort(int[] numbers) {
		
		
		//List<Integer> numberList = new ArrayList<Integer>();
		
		Object[] sortedNumbers;
		// convert the array to a List
		
		
		
		
		// call the adapter
		NumberSorter sorter = new NumberSorter();
		//numberList = sorter.sort(numbers);
		 sortedNumbers = sorter.sort(numbers).toArray();
		// convert the list back to an array and return
		 
		 for (int i = 0; i < sortedNumbers.length; i++) {
			System.out.println(sortedNumbers[i]);
		}
		return sortedNumbers;

	}
}



